package com.sne.airways.system.service;

import com.sne.airways.basecore.exceptions.AppException;
import com.sne.airways.system.dto.TdUserCheckDTO;
import com.sne.airways.system.dto.TdUserDTO;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: skyline{http://my.oschina.net/skyline520}
 * Date: 12-11-23
 * Time: 下午5:48
 * To change this template use File | Settings | File Templates.
 */
public interface UserService {
    /**
     * 查询用户列表
     * @param userNo
     * @param userName
     * @param status
     * @param start
     * @param limit
     * @return
     */
    public List<TdUserDTO> queryUserList(String userNo, String userName, String status, int start, int limit) throws AppException;

    /**
     * 查询用户记录总数
     * @param userNo
     * @param userName
     * @param status
     * @return
     */
    public Integer queryUserCount(String userNo, String userName, String status) throws AppException;
    /**
     * 保存用户
     * @param userNo
     * @param userName
     * @param password
     * @param subsectionId
     * @param userPhone
     * @param userTel
     * @param userMobile
     * @param userQQ
     * @param userMsn
     * @param userMail
     * @param userRemark
     * @param status
     * @param version
     * @return
     * @throws AppException
     */
    public void saveUser(String userNo,String userName,String password,
                              String subsectionId,String userPhone,String userTel,String userMobile,
                              String userQQ,String userMsn,String userMail,String userRemark,String status,int version) throws AppException;

    /**
     * 编辑用户
     * @param userId
     * @param userNo
     * @param userName
     * @param password
     * @param subsectionId
     * @param userPhone
     * @param userTel
     * @param userMobile
     * @param userQQ
     * @param userMsn
     * @param userMail
     * @param userRemark
     * @param status
     * @param version
     * @return
     * @throws AppException
     */
    public void updateUser(String userId,String userNo,String userName,String password,
                                String subsectionId,String userPhone,String userTel,String userMobile,
                                String userQQ,String userMsn,String userMail,String userRemark,String status,int version) throws AppException;

    /**
     * 根据userId和version 删除用户对象
     * @param userId
     * @param version
     * @throws AppException
     */
    public void deleteUser(String userId,int version) throws AppException;
    public List<TdUserCheckDTO> queryUserCheckedList(String roleId,String userNo,String userName, String status) throws AppException;

    /**
     * 根据roleId 以及ids 保存用户角色关联关系
     * @param userId
     * @param ids
     * @param version
     */
    public void saveUserRole(String userId,String[] ids,int version);
}
